<template>
  <div>
    <div class="order"  v-if="orderData.id">
      <el-row type="flex" class="row-bg" justify="space-between">
        <!-- 左边信息 -->
        <OrderForm :orderData='orderData'  @moneyTotal='moneyTotal'></OrderForm>
        <!-- 右边信息 -->
          <OrderMessage :orderData='orderData' :money='money'></OrderMessage>
      </el-row>
    </div>
  </div>
</template>

<script>
import OrderForm from '../../components/air/OrderForm'
import OrderMessage  from '../../components/air/OrderMessage'
export default {
  data() {
    return {
      orderData:{},
      money:0
    }
  },
  methods: {
    // 获取数据
    getAirs(){
      const { id,seat_xid} = this.$route.query
      // console.log('seat_xid: ', seat_xid);
      // console.log('id: ', id);
      this.$axios({
        url:'/airs/'+id,
        params: {
          seat_xid
        }
      }).then(res=>{
        this.orderData = res.data
        // console.log('orderData: ', this.orderData);
        
      })
    },
    // 子组件传来的金额
    moneyTotal(money) {
   this.money = money.toFixed(2)
    }
  },
  mounted() {
    this.getAirs()
// console.log("this.$route.query: ", this.$route.query);
  },
  components:{
    OrderForm,OrderMessage
  }
};
</script>

<style lang="less" scoped>
.order {
  width: 1000px;
  margin: auto;
}

</style>